<template>
  <lazyCommonHeader> 语法测试主页 </lazyCommonHeader>
  <h2>父子组件传参测试</h2>
  <el-input v-model="userInfo.name"></el-input>
  <cUserInfoPrevew @changeUserAge="changeUserAge" :userInfo="userInfo" :name="userInfo.name" />
  <cUserInfoPrevewOne  :userInfo="userInfo" />
</template>
<script setup>
const state = reactive({
  userInfo: {
    name: "",
    age:5
  },
});

const { userInfo } = toRefs(state);

function changeUserAge(age) {
  state.userInfo.age = age;
}
</script>
